// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.expr.SQLCharExpr_ptr;
// import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "MySqlExecuteForAdsStatement.h"
#include "../../../../ast/SQLName.h"
#include "../../../../ast/SQLObject.h"
#include "../../../../ast/expr/SQLCharExpr.h"
#include "../../visitor/MySqlASTVisitor.h"

// @Override
void MySqlExecuteForAdsStatement::accept0(MySqlASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(MySqlExecuteForAdsStatement)))
  {
    acceptChild(visitor, action);
    acceptChild(visitor, role);
    acceptChild(visitor, targetId);
    acceptChild(visitor, status);
  }
  visitor->endVisit(SharedObject(MySqlExecuteForAdsStatement));
}

SQLName_ptr MySqlExecuteForAdsStatement::getAction()
{
  return action;
}

void MySqlExecuteForAdsStatement::setAction(SQLName_ptr action)
{
  this->action = action;
}

SQLName_ptr MySqlExecuteForAdsStatement::getRole()
{
  return role;
}

void MySqlExecuteForAdsStatement::setRole(SQLName_ptr role)
{
  this->role = role;
}

SQLCharExpr_ptr MySqlExecuteForAdsStatement::getTargetId()
{
  return targetId;
}

void MySqlExecuteForAdsStatement::setTargetId(SQLCharExpr_ptr targetId)
{
  this->targetId = targetId;
}

SQLName_ptr MySqlExecuteForAdsStatement::getStatus()
{
  return status;
}

void MySqlExecuteForAdsStatement::setStatus(SQLName_ptr status)
{
  this->status = status;
}

// @Override
SQLObject_list_ptr MySqlExecuteForAdsStatement::getChildren()
{
  SQLObject_list_ptr children = std::make_shared<std::list<SQLObject_ptr>>();
  if (action != nullptr)
  {
    children->push_back(action);
  }
  if (role != nullptr)
  {
    children->push_back(role);
  }
  if (targetId != nullptr)
  {
    children->push_back(targetId);
  }
  if (status != nullptr)
  {
    children->push_back(status);
  }
  return children;
}
